# latchedButton object example

The following example shows the latchedButton object:

`<latchedButton name="LatchedPushButton1" height="45" width="99" left="19" top="276" visible="true" wallpaper="false" isReferenceObject="false" audio="true" backStyle="solid" borderStyle="raisedInset" borderUsesBackColor="false" borderWidth="4" description="" highlightColor="lime" horizontalMargin="0" verticalMargin="0" shape="rectangle" touch="true" latchResetType="nonZeroValue" currentStateId="0" captionOnBorder="False" keyAssignment="F8">`

`<states>`

`<state stateId="Error" backColor="navy" borderColor="navy" patternColor="white" patternStyle="none" blink="false">`

`<caption fontFamily="Arial" fontSize="10" bold="false" italic="false" underline="false" strikethrough="false" caption="latched Error" color="white" backColor="navy" backStyle="transparent" alignment="middleCenter" wordWrap="true" blink="false" />`

`<imageSettings imageName="" alignment="middleCenter" backStyle="transparent" color="white" backColor="navy" scaled="false" blink="false" />`

`</state>`

`<state stateId="0" value="0" backColor="#008C00" borderColor="#404000" patternColor="white" patternStyle="none" blink="false">`

`<caption fontFamily="Baskerville Old Face" fontSize="10" bold="false" italic="false" underline="false" strikethrough="false" caption="LATCHED" color="magenta" backColor="#FFC0FF" backStyle="transparent" alignment="middleCenter" wordWrap="true" blink="false" />`

`<imageSettings imageName="" alignment="middleCenter" backStyle="transparent" color="white" backColor="navy" scaled="false" blink="false" />`

`</state>`

`<state stateId="1" value="1" backColor="navy" borderColor="navy" patternColor="white" patternStyle="none" blink="false">`

`<caption fontFamily="Arial" fontSize="10" bold="false" italic="false" underline="false" strikethrough="false" caption="LATCHED 1" color="white" backColor="navy" backStyle="transparent" alignment="middleCenter" wordWrap="true" blink="false" />`

`<imageSettings imageName="" alignment="middleCenter" backStyle="transparent" color="white" backColor="navy" scaled="false" blink="false" />`

`</state>`

`</states>`

<animations>

`<animateVisibility expression="TagS2" expressionTrueState="visible" />`

`</animations>`

`<connections>`

`<connection name="Value" expression="TagS2" />`

`<connection name="Indicator" expression="TestS2" />`

`<connection name="Handshake" expression="n7" />`

`</connections>`

`</latchedButton>`

## See also

Push button objects: latchedButton object

latchedButton object attributes and elements